import request from '@/utils/request'

export function loginByUsername(username, password) {
  const data = {
    username,
    password
  }
  return request({
    url: 'login/login/index',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: 'login/logout',
    method: 'post'
  })
}

export function getUserInfo(token) {
  return request({
    url: 'seller/seller_admin/info_by_token',
    method: 'post',
    params: { token }
  })
}

export function getRouter(token) {
  return request({
    url: 'shop_admin_auth/admin_page/get_page_tree',
    method: 'post',
    params: { token }
  })
}
// 原获取后台路由
// export function getRouter(token) {
//   return request({
//     url: 'login/admin_user/info',
//     method: 'get',
//     params: { token }
//   })
// }

